package com.thm.tfast.core.config;

import com.thm.tfast.core.config.properties.MinioProp;
import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @ClassName MinioConfig
 * @Author THM
 * @Date 2022/10/27 15:02
 * @Version 1.0
 * @Description minio配置
 */
@Configuration
public class MinioConfig {

    @Resource
    private MinioProp minioProp;

    @Bean
    public MinioClient minioClient() {
        return MinioClient
                .builder()
                .endpoint(minioProp.getEndpoint())
                .credentials(minioProp.getAccessKey(),minioProp.getSecretKey())
                .build();
    }
}
